package com.hrp.controller;

import com.hrp.service.AccountsReceivableService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * Created by Administrator on 2019-05-09.
 */
@RestController
@RequestMapping("accountsReceivable")
public class AccountsReceivableController {

    @Autowired
    private AccountsReceivableService accountsReceivableService;



    @RequestMapping("/getAccountsReceivableByPage")
    public Map<String,Object> getTransportRecordByPage( @RequestParam(name = "page", defaultValue = "1") Integer page,
                                                        @RequestParam(name = "rows", defaultValue = "300") Integer rows,
                                                       @RequestParam(name = "startTime", defaultValue = "2018-01-01") String startTime,
                                                       @RequestParam(name = "endTime", defaultValue = "2018-01-01") String endTime,
                                                        @RequestParam(name = "receiverIdStr", defaultValue = "-1") String receiverIdStr) {

        return accountsReceivableService.getAccountsReceivableByPage(page,rows,startTime,endTime,receiverIdStr);
    }

    @RequestMapping("/datagridMergeCells")
    public List<Map<String,Object>> getdatagridMergeCells(@RequestParam(name = "startTime", defaultValue = "2018-01-01") String startTime,
                                                          @RequestParam(name = "endTime", defaultValue = "2018-01-01") String endTime,
                                                          @RequestParam(name = "receiverIdStr", defaultValue = "-1") String receiverIdStr) {

        return accountsReceivableService.getdatagridMergeCells(startTime,endTime,receiverIdStr);
    }


}
